<?php

namespace app\controllers;

use Yii;
use yii\web\Controller;
use yii\web\Request;
use yii\web\Response;
use proxy\HttpProxy;
use helper\SessionHelper;

class CouponController extends SecBaseController
{
    public function actionList(){
        $request = Yii::$app->request;
        $page_code = $request->get('page_code');
        $sort_code = $request->get('sort_code');
        $sortorder = $request->get('sortorder');
        $this->remote_params['page_code'] = $page_code;
        $this->remote_params['sort_code'] = $sort_code;
        $this->remote_params['sortorder'] = $sortorder;

        try{ 
            $ret = $this->proxy->execute('coupon', 'list', $this->remote_params);
            $this->return_page_values = array_merge($this->return_page_values, $ret);
        }catch(\Exception $e){
            $this->return_page_values['errno'] = $e->getCode();
            $this->return_page_values['errmsg'] = $e->getMessage();
            return $this->myRenderFile('@tpl/page/error.tpl', $this->return_page_values);
        }

        return $this->myRenderFile('@tpl/page/coupon/list.tpl', $this->return_page_values);
        
    }

   

    
}
